home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 117 / PC Guia 117.iso / Software / Utils / Software2 / Product11 / Setup.exe / MT-3.16-full-en_US / mt-search.cgi < prev    next >
Text File  |  2005-03-08  |  769b  |  33 lines

  1. #!/usr/bin/perl -w
  2.  
  3. # Original copyright 2001-2002 Jay Allen.
  4. # Modifications and integration Copyright 2001-2005 Six Apart.
  5. # This code cannot be redistributed without
  6. # permission from www.movabletype.org.
  7. #
  8. # $Id: mt-search.cgi 10197 2005-03-09 00:27:57Z ezra $
  9. use strict;
  10.  
  11. my($MT_DIR);
  12. BEGIN {
  13.     if ($0 =~ m!(.*[/\\])!) {
  14.         $MT_DIR = $1;
  15.     } else {
  16.         $MT_DIR = './';
  17.     }
  18.     unshift @INC, $MT_DIR . 'lib';
  19.     unshift @INC, $MT_DIR . 'extlib';
  20. }
  21.  
  22. eval {
  23.     require MT::App::Search;
  24.     my $app = MT::App::Search->new( Config => $MT_DIR . 'mt.cfg' )
  25.         or die MT::App::Search->errstr;
  26.     local $SIG{__WARN__} = sub { $app->trace($_[0]) };
  27.     $app->run;
  28. };
  29. if ($@) {
  30.     print "Content-Type: text/html\n\n";
  31.     print "Got an error: $@";
  32. }
  33.